from selenium import webdriver
from conf.excel import row, excel
from datetime import datetime
from huoke import hk
from loguru import logger



driver = webdriver.Chrome()
driver.implicitly_wait(100)
driver.maximize_window()
excel.write_excel(l=1, h=row, val=f"{str(datetime.now().strftime('%Y-%m-%d %H:%M:%S'))}")  # 记录开始执行时间
hk.login(driver, 'https://dx.yayi360.com/#/', '13698420336', '123456')  # 正式环境
# hk.login(driver, 'https://dxt.yayi360.com/#/', '19900000002', '111111')  # 内测环境
i = 86  # 患者命名
count = 0  # 执行次数
while True:

    excel.write_excel(l=4, h=row, val=count)  # 记录执行的次数
    # hk.crete_order(driver, i, '正丽技师一号')
    hk.crete_order(driver, i, '小丸子')
    hk.huoke(driver)
    i += 1
    count += 1
    logger.info(f'执行第{count}次结束')
